package cc.yaomm.service.basic.controller.business.user.vo;

import cc.yaomm.common.basic.enums.StatusEnum;
import cc.yaomm.common.basic.lang.vo.BaseParamVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;
import java.util.Set;

/**
 * Created by XQL on 2021/6/9.
 */
@Data
@ApiModel
public class RoleParamVO extends BaseParamVO {

    public interface Lock {
    }

    @ApiModelProperty("角色ID")
    @NotNull(message = "角色ID不能为空", groups = {RoleParamVO.Lock.class, RoleParamVO.SetPermission.class})
    private Long id;
    /**
     * 角色名称
     */
    @ApiModelProperty("角色名")
    @NotEmpty(message = "角色名称不能为空", groups = Edit.class)
    @Size(max = 64, message = "角色名称不能超过64个字")
    private String name;
    /**
     * 权限ID集合
     */
    @ApiModelProperty("权限ID集合")
    @NotEmpty(message = "权限不能为空", groups = RoleParamVO.SetPermission.class)
    private List<Long> permissionIds;

    @ApiModelProperty("查询条件（角色名/说明)")
    @Size(max = 64, message = "查询关键字不能超过64个字")
    private String keyword;

    public interface Edit {
    }

    /**
     * 角色说明
     */
    @ApiModelProperty("角色说明")
    @Size(max = 128, message = "角色名称不能超过128个字")
    private String note;

    /**
     * 备注
     */
    @ApiModelProperty("角色备注")
    @Size(max = 512, message = "角色备注不能超过512个字")
    private String remark;

    @ApiModelProperty("状态")
    @NotNull(message = "角色状态不能为空", groups = RoleParamVO.Lock.class)
    private StatusEnum status;

    public interface SetPermission {
    }
}
